package com.landscope.central.controller.api;

import com.landscope.central.controller.api.dto.AuthorizeDto;
import com.landscope.central.controller.api.param.ApiUserAuthorizeParam;
import com.landscope.central.controller.base.BaseController;
import com.landscope.central.controller.base.ResponseResult;
import com.landscope.central.render.Result;
import com.landscope.central.service.api.ApiUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 用户接口
 *
 * @author qzp
 * @version v1.0
 * @date 2021/6/28 10:20
 **/
@RestController
@RequestMapping("api/m/user")
@Api(tags = "1.终端用户")
@CrossOrigin
public class ApiUserController extends BaseController {

    @Resource
    private ApiUserService apiUserService;

    /**
     * 终端授权获取凭证
     *
     * @param param:
     * @return {@link * @return java.lang.Object}
     * @throws
     * @author 瞿子朋
     * @date 2021/6/28 13:58
     * @version v1.0
     **/
    @PostMapping("/authorize")
    @ApiOperation(value = "终端授权获取凭证",notes = "终端授权获取凭证")
    public ResponseResult<AuthorizeDto> authorize(@RequestBody @Validated ApiUserAuthorizeParam param) {
        return apiUserService.authorize(param);
    }
}
